<?php
// 创建连接
$conn = new mysqli("localhost", "root", "root", "xyq");
if ($conn->connect_error) {
    die("连接失败: " . $conn->connect_error);
}
$id = $_COOKIE['id'];
var_dump($id);
$pwd = $_GET["pwd"];
$sql = "SELECT password FROM `xyq` WHERE id='$id'";
$reslt = $conn->query($sql);
if ($reslt->fetch_assoc()['password'] === $pwd) {
    $del_sql = "DELETE FROM `xyq` WHERE id='$id' ";
    $conn->query($del_sql);
    echo "删除成功";
    header("Location:index.php");
} else {
     echo "密码错误，删除失败";  
//echo '<script>alert("密码错误，删除失败")</script>';  
    header("Location:verify_del.php?id=$id");
   
}
?>